import Sensors.*;

public class SpecificCollector implements Runnable {
	
	Collector collector;
	Sensor sensor;
	
	public SpecificCollector () {
		// Create a collector that publishes events to FRAMSELF on 127.0.0.1:5000
		collector = new Collector("127.0.0.1",5000);
	}
	
	//Si trop lent, donc besoin d'un thread
	public SpecificCollector (Sensor sensor) {
		// Create a collector that publishes events to FRAMSELF on 127.0.0.1:5000
		collector = new Collector("127.0.0.1",5000);
		this.sensor = sensor;
	}

	@Override
	public void run() {
		sendData(sensor);
	}
	
	public void sendData (Sensor sensor) {
		collector.send(sensor.getEvent());
	}
}
